<template>
	<div class="item_bg">
		 <div class="img_wrapper">
      <img class="" src="http://image.utea88.com/statics/pc_newHome_bg_03.png" alt="">
      <div class="big_title_bg">
        <div class="big_title">合作加盟</div>
        <div class="big_desc">共创 / 共赢 / 共享</div>
      </div>

      <div class="bottom_section">
        <div @click="goToWeChat" :class="[isActive ? 'animation1' : '', 'content_bg', 'left_item_section']">
          <div class="img_bg">
            <img src="https://image.utea88.com/statics/pc_cooperation_icon_3.png" alt="">
          </div>
          <div class="title">成为城市合伙人</div>
          <div class="desc">{{ desc1 }}</div>
          <div class="arrow_bg">
            <img src="https://image.utea88.com/statics/pc_cooperation_arrow.png" alt="">
          </div>
          <div class="click">CLICK UP</div>
        </div>

        <div @click="toAgreement" :class="[isActive ? 'animation2' : '', 'content_bg', 'middle_item_section']">
          <div class="img_bg">
            <img src="https://image.utea88.com/statics/pc_cooperation_icon_1.png" alt="">
          </div>
          <div class="title">成为供应商/采购商</div>
          <div class="desc">{{ desc2 }}</div>
          <div class="arrow_bg">
            <img src="https://image.utea88.com/statics/pc_cooperation_arrow.png" alt="">
          </div>
          <div class="click">CLICK UP</div>
        </div>

        <div @click="toChaCang" :class="[isActive ? 'animation3' : '', 'content_bg', 'right_item_section']">
          <div class="img_bg">
            <img src="https://image.utea88.com/statics/pc_cooperation_icon_2.png?t=1" alt="">
          </div>
          <div class="title">加盟众茶仓</div>
          <div class="desc">{{ desc3 }}</div>
          <div class="arrow_bg">
            <img src="https://image.utea88.com/statics/pc_cooperation_arrow.png" alt="">
          </div>
          <div class="click">CLICK UP</div>
        </div>
      </div>
     </div>
	</div>
</template>

<script>

	export default {
    name: '',
    props: {
      activeIndex: {
        default: '',
        type: Number,
      },
    },
		components: {
			
		},
    watch: {
      activeIndex(newValue, oldValue) {
        if (newValue == this.index) {
          this.isActive = true
        } else {
          this.isActive = false
        }
      }
    },
		data() {
			return {
        index: 3,
        isActive: false,
        desc1: "城市合伙人集结号\n诚邀您开启千万收益征途",
				desc2: "免费入驻众茶通\n助力茶叶变现，自由交易",
        desc3: "签约客户，非加盟仓、其产品\n库存数据在众茶国际云仓中心同步",
			}
		},
		methods: {
      toChaCang() {
        this.$router.push({
          path: "/front-storeCenter",
        });
			},
			toAgreement() {
				this.$router.push({
					name: "frontAgreement"
				});
			},
			goToWeChat() {
				window.open('https://mp.weixin.qq.com/s/X4tAcCQADL2M1i6FZQjNFQ',"_blank")
			}
  	},
    mounted(){
      
    }
	}
</script>

<style scoped lang="scss">
  .item_bg {
    position: relative;
    width: 100%;
    height: 100%;
  }

  .img_wrapper {
    position: relative;
    width: 100%;
    height: 100%;

    img {
      width: 100%;
      height: 100%;
    }

    .big_title_bg {
      position: absolute;
      width: 100%;
      height: 174px;
      top: 0;
      left: 0;
      display: flex;
      flex-direction: column;
      align-items: center;

      .big_title {
        height: 105px;
        opacity: 1;
        /** 文本1 */
        font-size: 72px;
        font-weight: 700;
        letter-spacing: 5px;
        line-height: 105px;
        color: rgba(255, 255, 255, 1);
        text-align: center;
        vertical-align: top;
      }

      .big_desc {
        margin-top: 5px;
        height: 64px;
        opacity: 1;
        /** 文本1 */
        font-size: 48px;
        font-weight: 400;
        letter-spacing: 0px;
        line-height: 63.84px;
        color: rgba(255, 255, 255, 1);
        text-align: center;
        vertical-align: top;
      }
    }
  }

  .bottom_section {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 600px;

    .left_item_section {
      top: 0;
    }

    .middle_item_section {
      left: calc(50% - 350px / 2)
    }

    .right_item_section {
      top: 0;
      right: 0;
    }
  }

  .content_bg {
    position: absolute;
    opacity: 0;
    width: 350px;
    height: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
		cursor: pointer;

    .img_bg {
      margin-top: 40px;
      width: 150px;
      height: 150px;

      img {
        width: 100%;
        height: 100%;
      }
    }

    .title {
      margin-top: 34px;
      height: 40px;
      opacity: 1;
      /** 文本1 */
      font-size: 30px;
      font-weight: 400;
      letter-spacing: 0px;
      line-height: 40px;
      color: rgba(15, 131, 193, 1);
      text-align: center;
      vertical-align: middle;
    }

    .desc {
      margin-top: 18px;
      height: 48px;
      height: 48px;
      opacity: 0.9;
      /** 文本1 */
      font-size: 18px;
      font-weight: 400;
      letter-spacing: 0px;
      line-height: 24px;
      color: rgba(102, 102, 102, 1);
      text-align: center;
      vertical-align: middle;
      white-space: pre-wrap;
    }

    .arrow_bg {
      margin-top: 34px;
      width: 30px;
      height: 30px;

      img {
        width: 100%;
        height: 100%;
      }
    }

    .click {
      margin-top: 14px;
      height: 22px;
      opacity: 0.9;
      /** 文本1 */
      font-size: 16px;
      font-weight: 400;
      letter-spacing: 0px;
      line-height: 22px;
      color: rgba(204, 204, 204, 1);
      text-align: center;
      vertical-align: middle;
    }
  }

  .animation1 {
    left: calc((100% - 1150px) / 2);
    animation: move1 0.8s linear forwards;
  }

  .animation2 {
    bottom: 140px;
    animation: move2 0.8s linear forwards;
  }

  .animation3 {
    left: calc(50% + 350px / 2 + 50px);
    animation: move3 0.8s linear forwards;
  }

  @keyframes move1 {
    0% {
      left: 0;
      opacity: 0;
    }

    100% {
      left: calc((100% - 1150px) / 2);
      opacity: 1;
    }
  }

  @keyframes move2 {
    0% {
      bottom: 0;
      opacity: 0;
    }

    100% {
      bottom: 140px;
      opacity: 1;
    }
  }

  @keyframes move3 {
    0% {
      left: calc(100% - 350px);
      opacity: 0;
    }

    100% {
      left: calc(50% + 350px / 2 + 50px);
      opacity: 1;
    }
  }
</style>
